import requests
from settings import (
  API_KEY,
  PROXIES
)
# 获取电影的关键字
def get_movie_keywords_by_id(movie_id):
  url = f"https://api.themoviedb.org/3/movie/{movie_id}/keywords?api_key={API_KEY}"
  response = requests.get(url, proxies=PROXIES)
  data = response.json()
  return data

# 获取电影制作人员的相关信息
def get_movie_credits_by_id(movie_id):
  url = f"https://api.themoviedb.org/3/movie/{movie_id}/credits?api_key={API_KEY}"
  response = requests.get(url, proxies=PROXIES)
  data = response.json()
  return data

# 获取电影详细的信息
def get_movie_info_by_id(movie_id):
  url = f"https://api.themoviedb.org/3/movie/{movie_id}?api_key={API_KEY}"
  response = requests.get(url, proxies=PROXIES)
  data = response.json()
  return data

# 测试的时候使用
# get_movie_keywords_by_id(862)
# movie_credits_data = get_movie_credits_by_id(862)
# print(type(movie_credits_data))
# print(movie_credits_data)

# movie_detail_data = get_movie_credits_by_id(862)
# print(type(movie_detail_data))
# print(movie_detail_data)

